﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Message/Message.master" AutoEventWireup="true" CodeBehind="MessageNew.aspx.cs" Inherits="HRdex_Final.Message.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div align="center">
        <table style="background-color: #FFFFFF; border-style: double; border-color: #0066FF; width: 699px;" 
            align="center">
            <tr>
                <td colspan="2">
                    <asp:ImageButton ID="btnDelete" runat="server" Height="49px" 
                        onclick="btnDelete_Click" Width="52px" ImageUrl="~/Delete.png" 
                        ToolTip="Delete" CausesValidation="False" />
                    <asp:ImageButton ID="btnForward" runat="server" Height="49px" 
                        onclick="btnForward_Click" Width="52px" ImageUrl="~/Forward.png" 
                        ToolTip="Forward" CausesValidation="False" />
                    <asp:ImageButton ID="btnReply" runat="server" Height="49px" 
                        onclick="btnReply_Click" Width="52px" ImageUrl="~/Reply.png" 
                        ToolTip="Reply" CausesValidation="False" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel ID="pnlCreate" runat="server" Visible="False">
                        <table>
                            <tr>
                                <td ID="Title" style="width: 85px; text-align: left;">
                                    To</td>
                                <td ID="txtTitle">
                                    <asp:DropDownList ID="ddlToSend" runat="server" DataSourceID="MessageTo" 
                                        DataTextField="FullName" DataValueField="EmployeeID" Height="26px" 
                                        Width="309px">
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ControlToValidate="ddlToSend" ErrorMessage="*" ForeColor="Red" 
                                        Display="Dynamic"></asp:RequiredFieldValidator>
                                    <asp:SqlDataSource ID="MessageTo" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
                                        SelectCommand="SELECT EmployeeID, LastName + ', ' + FirstName AS FullName FROM formEmployees">
                                    </asp:SqlDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td ID="Title0" style="width: 85px; text-align: left;">
                                    Subject</td>
                                <td ID="txtTitle0">
                                    <asp:TextBox ID="txtSubject" runat="server" Width="300px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                        ControlToValidate="txtSubject" ErrorMessage="*" ForeColor="Red" 
                                        Display="Dynamic"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td ID="AnnouncementBody" style="width: 85px; height: 64px; text-align: left;">
                                    Body
                                </td>
                                <td ID="txtBody0" style="height: 64px">
                                    <asp:TextBox ID="txtBody" runat="server" Height="91px" TextMode="MultiLine" 
                                        Width="300px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                        ControlToValidate="txtBody" ErrorMessage="*" ForeColor="Red" 
                                        Display="Dynamic"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td ID="category" style="width: 85px; text-align: left;">
                                    Category
                                </td>
                                <td ID="CBcategory">
                                    <asp:DropDownList ID="ddlCategory" runat="server" DataSourceID="catMessege" 
                                        DataTextField="catMessegeName" DataValueField="catMessegeID" Height="16px" 
                                        Width="306px">
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                        ControlToValidate="ddlCategory" ErrorMessage="*" ForeColor="Red" 
                                        Display="Dynamic"></asp:RequiredFieldValidator>
                                    <asp:SqlDataSource ID="catMessege" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
                                        SelectCommand="SELECT [catMessegeName], [catMessegeID] FROM [catMessege]">
                                    </asp:SqlDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 85px; text-align: left;">
                                    Attach File
                                    <td>
                                        <asp:FileUpload ID="fuAttachment" runat="server" Width="306px" />
                                    </td>
                                    <tr>
                                        <td colspan="2">
                                            <asp:Button ID="txtSubmit" runat="server" onclick="txtSubmit_Click1" 
                                                Text="Send" Width="60px" />
                                            <asp:Button ID="txtCancel" runat="server" Text="Cancel" 
                                                onclick="txtCancel_Click" CausesValidation="False" />
                                            <br />
                                            <asp:Label ID="lblsent" runat="server" Text="Message Sent" Visible="False" 
                                                style="text-align: left; color: #0000FF; font-weight: 700; font-style: italic"></asp:Label>
                                        </td>
                                    </tr>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                    <asp:Panel ID="pnlRead" runat="server">
                        <table>
                            <tr>
                                <td style="width: 126px; text-align: left">
                                    From</td>
                                <td style="width: 266px; text-align: left">
                                    <asp:Label ID="lblTo" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 126px; text-align: left">
                                    To</td>
                                <td style="width: 266px; text-align: left">
                                    <asp:Label ID="lblFrom" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 126px; text-align: left">
                                    Subject</td>
                                <td style="width: 266px; text-align: left">
                                    <asp:Label ID="lblSubject" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 126px; text-align: left" valign="top">
                                    Description</td>
                                <td style="width: 266px; text-align: left">
                                    <asp:Label ID="lblDescription" runat="server" Height="139px" Width="249px"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 126px; text-align: left">
                                    Attach</td>
                                <td style="width: 266px; text-align: left">
                                    <asp:LinkButton ID="lblAttach" runat="server" onclick="lblAttach_Click">Download</asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 126px; text-align: left">
                                    Message Type</td>
                                <td style="width: 266px; text-align: left">
                                    <asp:Label ID="lblType" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 126px; text-align: left">
                                    Published</td>
                                <td style="width: 266px; text-align: left">
                                    <asp:Label ID="lblPubDate" runat="server"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
